import api from "../api.js" //先导入封装好的

//查询待认养蜂箱列表
const awaitList = async (param) => {
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/hives/await/list',
		data: param
	})
	return data
}
//查询已认养蜂箱列表
const myList = async (param) => {
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/hives/my/list',
		data: param
	})
	return data
}
//查询蜂箱详情
const hives = async (param) => {
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/hives/' + param,
		// url: '/jeecg-boot/api/adopt/introduce',
		// data: param
	})
	return data
}
//蜂箱分享海报
const shareHive = async (param) => {
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/share/hive/' + param.scene,
		// url: '/jeecg-boot/api/adopt/introduce',
		data: param
	})
	return data
}
//根据title查询认养介绍
const introduceTitle = async (param) => {
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/introduce/' + param,
		// url: '/jeecg-boot/api/adopt/introduce',
		// data: param
	})
	return data
}
//认养蜂箱
const adoptPay = async (param) => { 
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/pay',
		method: "POST",
		type: "application/x-www-form-urlencoded",
		data: param
	})
	return data
}
//获取以认养的蜂箱监控
const monitors = async (param) => { 
	console.log("进入方法---", param);
	let data = await api.api({
		url: '/jeecg-boot/api/adopt/monitors',
		data: param
	})
	return data
}

export {
	awaitList,
	myList,
	hives,
	shareHive,
	introduceTitle,
	adoptPay,
	monitors
}